{extend name='extra@admin/content'}

{block name="button"}
<div class="nowrap pull-right" style="margin-top:10px">
    <a class="layui-btn layui-btn-warm " href="{:url('cash/cashier')}" style="text-decoration: none" target="_blank">收银台</a>
    <button class="layui-btn layui-btn-normal ">暖色按钮</button>
    <button class="layui-btn layui-btn-danger ">警告按钮</button>
</div>
{/block}


{block name="content"}
<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="__SELF__" onsubmit="return false" method="get">
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">订单号</label>
        <div class="layui-input-inline">
            <input name="order_sn" value="{$Think.get.order_sn|default=''}" placeholder="请输入订单号" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">下单时间</label>
        <div class="layui-input-inline">
            <input name="date" id='range-date' value="{$Think.get.date|default=''}"
                   placeholder="请选择下单时间" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>
</form>
<!-- 表单搜索 结束 -->
<form onsubmit="return false;" data-auto="true" method="post">
    {if empty($list)}
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    {else}
    <input type="hidden" value="resort" name="action"/>
    <table class="layui-table" lay-skin="line" lay-size="sm">
        <thead>
        <tr>
            <th class='text-left nowrap'>ID</th>
            <th class='text-left nowrap'>订单号</th>
            <th class='text-left nowrap'>会员姓名</th>
            <th class='text-left nowrap'>手机</th>
            <th class='text-left nowrap'>商品数量</th>
            <th class='text-left nowrap'>支付金额</th>
            <th class='text-left nowrap'>支付方式</th>
            <th class='text-left nowrap'>订单状态</th>
            <th class='text-left nowrap'>创建时间</th>
            <th class='text-left nowrap'>退货时间</th>
            <th class='text-left nowrap'>操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name='list' id='vo'}
        <tr>
            <td class='text-left nowrap'>
                {$vo.id}
            </td>
            <td class='text-left nowrap'>
                {$vo.order_sn}
            </td>
            <td class='text-left nowrap'>
                {$vo.realname}
            </td>
            <td class='text-left nowrap'>
                {$vo.mobile}
            </td>
            <td class='text-left nowrap'>
                {$vo.goods_num}
            </td>
            <td class='text-left nowrap'>
                {$vo.final_amount}
            </td>
            <td class='text-left nowrap'>
                {if condition="$vo.pay_status eq 1"}
                {if condition="$vo.pay_type eq 1"}
                支付宝
                {elseif condition="$vo.pay_type eq 2"}
                微信支付
                {elseif condition="$vo.pay_type eq 3"}
                余额
                {elseif condition="$vo.pay_type eq 4"}
                现金
                {elseif condition="$vo.pay_type eq 5"}
                银行卡
                {/if}
                {else}
                未支付
                {/if}
            </td>
            <td class='text-left nowrap'>
                {if condition="$vo.order_status eq 0"}未支付
                {elseif condition="$vo.order_status eq 1"}已支付
                {elseif condition="$vo.order_status eq 2"}已确认
                {elseif condition="$vo.order_status eq 3"}已发货
                {elseif condition="$vo.order_status eq 4"}已收货
                {elseif condition="$vo.order_status eq 5"}退货申请中
                {elseif condition="$vo.order_status eq 6"}退货已处理
                {elseif condition="$vo.order_status eq 7"}订单已完成
                {/if}
            </td>
            <td class='text-left nowrap'>
                {$vo.addtime|date="Y-m-d H:i:s",###}
            </td>
            <td class='text-left nowrap'>
                {if $vo.tuihuo_sign == 0}
                无
                {elseif $vo.tuihuo_sign == 1}
                全部退货
                {else/}
                部分退货
                {/if}
            </td>
            <td class='text-left nowrap'>
                {if auth("$classuri/detail")}
                <span class="text-explode">|</span>
                <a data-open='{:url("$classuri/detail")}?id={$vo.id}' href="javascript:void(0)">详情</a>
                {/if}
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    {if isset($page)}<p>{$page}</p>{/if}
    {/if}
    <script>
        window.laydate.render({range: true, elem: '#range-date', format: 'yyyy/MM/dd'});
    </script>
</form>
{/block}
